package creator.abstractfactory.grade.sanguo;



import creator.abstractfactory.family.wujiang.*;

public class SanGuoWujiangProduct implements WujiangProduct {


    protected Camp camp;

    protected Life life;

    protected Numerical numerical;

    protected Treasure treasure;

    @Override
    public Camp GenerateCamp(String campName, String campAttribute) {
        Camp newCamp = new Camp(campName, campAttribute);
        this.camp = newCamp;
        return newCamp;
    }

    @Override
    public Life GenerateLife(String lifes) {
        Life newLife = new Life(lifes);
        this.life = newLife;
        return newLife;
    }

    @Override
    public Numerical GenerateNumerical(String name, String age, String aggressivity, String defensivePower, String healthValue, String specialValue) {
        Numerical newNumerical = new Numerical(name, age, aggressivity, defensivePower, healthValue, specialValue);
        this.numerical = newNumerical;
        return newNumerical;
    }

    @Override
    public Treasure GenerateTreasure(String treasureName, Numerical treasureNumerical) {
        Treasure newTreasure = new Treasure(treasureName, treasureNumerical);
        this.treasure = newTreasure;
        return treasure;
    }

    @Override
    public String show() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(numerical.getName() + " " + numerical.getAge() + " ;")
                .append(life.getLifes() + " ;")
                .append("属性值：" + numerical.toString())
                .append("宝物：" + treasure.toString());
        System.out.println(stringBuilder.toString());
        return stringBuilder.toString();
    }
}
